#pragma once
#include "Player/AnimPlayer.h"
#include "Tools/Singleton.h"

namespace LTGame
{
	class COrnament
	{
	public:
		COrnament(int animID);
		~COrnament();
		void paint();
		bool logic();

	private:
		void updateColBox();
		bool logicTrap();
		static const short ORN_SPEED = 5;

	public:
		float cur_x, cur_y;

		int listPos;
		int aniID;
		int m_actionID;
		short* col;
		AnimPlayer* m_player;
	};


	enum OrnType{
		Orn_None = -1,
		Orn_Stone,
		Orn_Trap,
	};

	class OrnamentList
		: public Singleton<OrnamentList>
	{
	public:
		OrnamentList();
		~OrnamentList();
		void Logic();
		void Paint();
		void init(OrnType type);

	public:
		bool isTrap(void);
		void destoryAll(void);
		COrnament** m_OrnamentList;

	private:
		void Create();
		int getEmptyPos(void);
		int getAnimationID(void);
		OrnType orn_type;
		int timer_orn;

	public:
		static const unsigned int MAX_ORN_COUNT = 5;
		static const short ORN_CREATE_TIME = 5;

	};
}